package org.airline.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.airline.utils.DateUtil;

@Entity
public class OrderItem {
	private Long id;
	private int isValid = 1; // 是否有效（1为有效机票，0为无效机票）
	private int isPayed = 0; // 是否已支付（1为已支付，0为未支付）
	private String createDate = DateUtil.parseToString(new Date()); // 订单生成时间
	private User user;
	private FlightArrange flightArrange;
	private int num = 1;
	private String memo;
	
	@Id
	@GeneratedValue
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	public int getIsValid() {
		return isValid;
	}
	public void setIsValid(int isValid) {
		this.isValid = isValid;
	}
	public int getIsPayed() {
		return isPayed;
	}
	public void setIsPayed(int isPayed) {
		this.isPayed = isPayed;
	}
	public String getCreateDate() {
		return createDate;
	}
	public void setCreateDate(String createDate) {
		this.createDate = createDate;
	}
	
	@ManyToOne
	@JoinColumn(name = "faID")
	public FlightArrange getFlightArrange() {
		return flightArrange;
	}
	public void setFlightArrange(FlightArrange flightArrange) {
		this.flightArrange = flightArrange;
	}
	
	@ManyToOne
	@JoinColumn(name = "userID")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public String getMemo() {
		return memo;
	}
	public void setMemo(String memo) {
		this.memo = memo;
	}
	public int getNum() {
		return num;
	}
	public void setNum(int num) {
		this.num = num;
	}
	
	
}
